package po;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.ElementCollection;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.Lob;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

import org.hibernate.annotations.GenericGenerator;

@Entity
@Table(name="customer")
public class Customer {
	
	
	public Customer() {
		super();
		// TODO Auto-generated constructor stub
	}


	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	//@GenericGenerator(name="ud",strategy="uuid")
	//@GeneratedValue(generator="ud")
	//private String id;
	
	//@SequenceGenerator(name="seq1",sequenceName="orcl_seq")
	//@GeneratedValue(strategy=GenerationType.TABLE,generator="seq1")
	//@GeneratedValue(strategy = GenerationType.TABLE) 
	private Integer id;
	
	@OneToMany(mappedBy="c",cascade=CascadeType.PERSIST,fetch=FetchType.LAZY)
	private Set<Address> addrs=new HashSet<Address>();
	
	
	@Column(name="c_name",nullable=true,columnDefinition="char(16)")
	private String cname;


	public Customer(Integer id,String cname){
		this.id=id;
		this.cname=cname;
	}
	
	public Set<Address> getAddrs() {
		return addrs;
	}


	public void setAddrs(Set<Address> addrs) {
		this.addrs = addrs;
	}


	public Integer getId() {
		return id;
	}


	public void setId(Integer id) {
		this.id = id;
	}


	public String getCname() {
		return cname;
	}


	public void setCname(String cname) {
		this.cname = cname;
	}
	
	
}
